﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;



public partial class Diem_DiemControl : System.Web.UI.UserControl
{
    public string nam { get; set; }
    public string masv { get; set; }
    public int count = 1;
    public int max = 1;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (nam.Length == 13)
        {
            busDiem busD = new busDiem();
            List<entDiem> lst = new List<entDiem>();
            lst = busD.getDiemHocKy(nam, masv);
            re_diem.DataSource = lst;
            re_diem.DataBind();
            string namhoc = nam.Substring(0, 9);
            string hocky = nam.Substring(10, 3);
            int hk;
            if (hocky.ToUpper() == "hk1".ToUpper())
            {
                hk = 1;
            }
            else
            {
                hk = 2;
            }
            lb_hk.Text = "Học kỳ " + hk + " năm " + namhoc + "";

            max = lst.Count;
            lst = new List<entDiem>();
            lst = busD.getDiemTBHocKy(nam, masv);
            if (lst.Count > 0)
            {
                lb_diemtb.Text = lst[0].Diem.ToString();
            }

        }

    }
}